﻿Imports Actuariat

Public Class Model

    Private correspNomDescCible(,) As String
    Private _universBDDomane As UniversOMANE
    Private _lParametres As ParametresList

    Public Property Univers() As UniversOMANE
        Get
            If _universBDDomane Is Nothing Then
                createModel()
            End If
            Return _universBDDomane
        End Get
        Private Set(ByVal value As UniversOMANE)
            _universBDDomane = value
        End Set
    End Property
    Public Property Parametres() As ParametresList
        Get
            If _lParametres Is Nothing Then
                createModel()
            End If
            Return _lParametres
        End Get
        Private Set(ByVal value As ParametresList)
            _lParametres = value
        End Set
    End Property

    Private Sub createModel()

        Univers = New UniversOMANE()
        init_correspNomDescCibles()

        ''Parametres = Univers.ListeParametres
        ''Parametres.Table_Mortalite_H.ajouteObserver(Univers.listeTraitements)
        ''Parametres.Table_Mortalite_F.ajouteObserver(Univers.listeTraitements)
        ''Parametres.GrilleTarifaire.ajouteObserver(Univers.listeTraitements)
        ''Parametres.Tble_maintienINCINVM2.ajouteObserver(Univers.listeTraitements)

        ''For Each champs As PTIC_GestionBDD.Correspondance In Univers.listeTraitements.getTraitTbleEncoursPrep1.ListeChampsSortie.Values
        ''champs.ajouteObserver(Univers.Segmentation)
        ''Next

        ''Univers.listeTraitements.getTraitMoteurMethode1.listeParametres = Parametres
        ''Univers.listeTraitements.getTraitMoteurMethode2.listeParametres = Parametres

        'Création des contrôleurs
        ''Dim controleurListeParametres As New baseControleurListParametres()
        'Initialisation des modèles et des contrôleurs
        ''Dim initialisationOMANE As New initParametrage(modeleUniversOMANE.refListeTablesReferentiel, _
        ''                                               controleurListeParametres, _
        ''                                               modeleListeParametres)
        ''Dim controleurOMANE As New Controleur(modeleUniversOMANE, _
        ''                                      controleurListeParametres, _
        ''                                      Nothing)

    End Sub

    'Initialisation des correspondances nom / description des champs cibles
    Private Sub init_correspNomDescCibles()
        Dim result(19, 1) As String
        result(0, 0) = "id_reseau"
        result(0, 1) = "Identifiant Réseau"
        result(1, 0) = "id_partenaire"
        result(1, 1) = "Identifiant Partenaire"
        result(2, 0) = "id_pret"
        result(2, 1) = "Identifiant Prêt"
        result(3, 0) = "id_assure"
        result(3, 1) = "Identifiant Assuré"
        result(4, 0) = "tr_age"
        result(4, 1) = "Tranche d'âge"
        result(5, 0) = "cap_ini"
        result(5, 1) = "Capital Initial"
        result(6, 0) = "dt_nais_assu"
        result(6, 1) = "Date de naissance Assuré"
        result(7, 0) = "dt_fin_pret"
        result(7, 1) = "Date fin prêt"
        result(8, 0) = "id_type_pret"
        result(8, 1) = "Identifiant type de prêt"
        result(9, 0) = "dt_debloc_fonds"
        result(9, 1) = "Date de déblocage des fonds"
        result(10, 0) = "tx_surprime"
        result(10, 1) = "Taux de surprime"
        result(11, 0) = "duree_mois"
        result(11, 1) = "Durée en mois"
        result(12, 0) = "cap_assu"
        result(12, 1) = "Capital assuré"
        result(13, 0) = "quotite_assu"
        result(13, 1) = "Quotité assurée"
        result(14, 0) = "tx_cotis"
        result(14, 1) = "Taux de cotisation"
        result(15, 0) = "tx_nominal"
        result(15, 1) = "Taux nominal du prêt"
        result(16, 0) = "cat_pret"
        result(16, 1) = "Catégorie de prêt"
        result(17, 0) = "id_option"
        result(17, 1) = "Identifiant option"
        result(18, 0) = "sexe_assu"
        result(18, 1) = "Sexe de l'assuré"
        result(19, 0) = "pres_ITT/IPT"
        result(19, 1) = "Présence de l'IT/IPT sur l'option"
        correspNomDescCible = result
    End Sub

End Class